using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace _395_2d
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class Background : Microsoft.Xna.Framework.DrawableGameComponent
    {
        private Vector2 position;
        private SpriteBatch spritebatch;

        Texture2D texture;

        public Background(Game game)
            : base(game)
        {
            position = new Vector2(0, -3616);
        }

        protected override void LoadContent()
        {
            spritebatch = new SpriteBatch(this.Game.GraphicsDevice);
            texture = Game.Content.Load<Texture2D>("NewBackground");

            base.LoadContent();
        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            spritebatch.Begin();
            spritebatch.Draw(texture, position, null, Color.White, 0f, new Vector2(0, 0), new Vector2(1,2), SpriteEffects.None, 0);
            spritebatch.End();
        }

        public override void Update(GameTime gameTime)
        {
            // TODO: Add your update code here
            position.Y += 25 * (float)gameTime.ElapsedGameTime.TotalSeconds;
            base.Update(gameTime);
        }
    }
}
